Copy Generic Method

Wintellect PowerCollections

Collapse imageExpand ImageCollapseAll imageExpandAll imageDropDown imageDropDownHover imageCopy imageCopyHover image
[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

Copies count items from the list or array source, starting at the index sourceIndex, to the array dest, starting at the index destIndex. The source may be the same as the destination array.

Namespace: Wintellect.PowerCollections
Assembly:  PowerCollections (in PowerCollections.dll)

Syntax

C#
public static void Copy<T>(
	IList<T> source,
	int sourceIndex,
	T[] dest,
	int destIndex,
	int count
)
Visual Basic (Declaration)
Public Shared Sub Copy(Of T) ( _
	source As IList(Of T), _
	sourceIndex As Integer, _
	dest As T(), _
	destIndex As Integer, _
	count As Integer _
)
Visual C++
public:
generic<typename T>
static void Copy (
	IList<T>^ source, 
	int sourceIndex, 
	array<T>^ dest, 
	int destIndex, 
	int count
)

Parameters

source
IList<(Of <T>)>
The list or array that provide the source items.
sourceIndex
Int32
The index within sourceto begin copying items from.
dest
array<T>[]()
The array to store the items into.
destIndex
Int32
The index within destto begin copying items to.
count
Int32
The maximum number of items to copy. The destination array must be large enough to hold this many items.

Type Parameters

T

Exceptions

ExceptionCondition
System..::ArgumentOutOfRangeExceptionsourceIndex is negative or greater than source.Count
System..::ArgumentOutOfRangeExceptiondestIndex is negative or greater than dest.Length
System..::ArgumentOutOfRangeExceptioncount is negative or too large.
System..::ArgumentNullExceptionsource or dest is null.

See Also